var usernameVar = GetURLParameter('username'),
    job = GetURLParameter('job');

$('#usernameText').html(usernameVar);
$('#jobText').append(job);
function login(){
    var passwordVar = $('#passwordBox').val();

    // gui tin hieu den server
    socket.emit('checkLogin', {sendUsername: usernameVar, sendPassword: passwordVar });
}
// nhan tin hieu tu server
socket.on("checkLogin", function(data) {
    if(data.allUser==null){
        $('#error').html(data.error);
    } else {
        var listAllUser = '<table border="1px"><tr><td>userID</td><td>username</td><td></td></tr>';
        for(var i=0;i<data.allUser.length;i++){
            listAllUser += '<tr class="odd gradeX">';
            listAllUser += '<td>' + data.allUser[i].userID + '</td>';
            listAllUser += '<td>' + data.allUser[i].username + '</td>';
            listAllUser += '<td><input type="checkbox" id="checkbox' + i + '"></td>';
            listAllUser += '</tr>';
        }
        listAllUser += '</table>';
        $('#dataTable').html(listAllUser);
    }
});

function checkbox(){
    if($('#checkbox').prop('checked')) {
        var checked = 1;    //true
    } else {
        checked = 0;        //false
    }

}